<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Home page</title>
        <link rel="stylesheet"  type="text/css" href="<spring:url value="/resources/css/bootstrap.css" />" />
        <link rel="stylesheet" type="text/css" href="<spring:url value="/resources/css/jumbo.css" />" />
        <link rel="stylesheet" type="text/css" href="<spring:url value="/resources/css/templates.css" />"/>
    </head>
    <body>
        <div id="wrap">
            <div class="container test">
                <div class="masthead">
                    <security:authorize access="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')">
                        <a href="<spring:url value="/j_spring_security_logout" />" class="btn pull-right">Logout</a>
                        <a href="<spring:url value="/profile" />" title="Profile" class="btn-link pull-right" style="padding-right: 5px">
                            <security:authentication property="principal.username" />
                        </a>
                    </security:authorize>
                    <security:authorize access="isAnonymous()">
                        <form id="sing-in" class="form-inline  pull-right" action="<spring:url value="/j_spring_security_check" />" method="post">
                            <input class="span2" type="text" placeholder="Email" name="j_username" />
                            <input class="span2" type="password" placeholder="Password" name="j_password" />
                            <button type="submit" class="btn">Sign in</button>
                        </form>
                    </security:authorize>
                    <h3 class="muted">Pretty good gallery</h3>
                    <jsp:include page="templates/navbar.jsp" />
                </div>
                <security:authorize access="isAnonymous()">
                    <div class="jumbotron">
                        <h1>Create your own gallery!</h1>
                        <p></p>
                        <a class="btn btn-large btn-success" href="<spring:url value="/register" />">Get started</a>
                    </div>
                </security:authorize>
                <div id="push" ></div>
            </div>
        </div>
        <jsp:include page="templates/footer.jsp" />
        <script src="<spring:url value="/resources/js/jquery-2.0.0.js" />"></script>
        <script src="<spring:url value="/resources/js/bootstrap.js" />"></script>
        <script src="<spring:url value="/resources/js/templates.js" />"></script>
    </body>
</html>